<template>
    <div class="video">
        <el-form ref="form" :model="form"  label-width="100px">
            <el-form-item label="音频类型">
                <el-radio v-model="form.video" label="local">本地视频</el-radio>
                <el-radio v-model="form.video" label="online">线上视频</el-radio>
            </el-form-item>
            <div v-if="form.video === 'local'" >
                <el-form-item>
                    <upload-video
                    @remove="removePic"
                    @success="uploadSuccess">
                    </upload-video>
                </el-form-item>
                <div class="el-upload__tip" style="margin-left: 100px">仅可上传一个文件（视频/音频），视频仅支持MP4，音频仅支持MP3，音/视频大小不得超过2G.</div>

            </div>
            <div v-else>
                <el-form-item>
                    <el-input
                        type="textarea"
                        :rows="4"
                        placeholder="请输入视频地址"
                        v-model="form.textarea">
                    </el-input>
                </el-form-item>
            </div>
        </el-form>
    </div>
</template>
<script>
/**
* description: 视频模块
*/    

import uploadVideo from '../upload/upload_video.vue'
    export default {
        components: {
            uploadVideo,
        },
        data() {
            return {
                form: {
                    video: 'local',
                    textarea: '',
                    uploadForm: []
                }
            }
        },
        methods: {
            uploadSuccess(file,fileList) {
                this.form.uploadForm = fileList
            },
            removePic(file,fileList) {
                this.form.uploadForm = fileList
            },
            submit() {
                // todo 提交数据给后端
            },
        }
    }
</script>
<style lang="scss" scoped>
.video {
    position: relative;
    // margin-left: 44px;
    padding-bottom: 10px;
}
::v-deep.el-select .el-input {
    width: 100px;
}
</style>